package com.sysfrog.cucumber;

/*
* Copyright (C) 2010 Thomas Heggelund
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.FileTypeConsumer;
import com.intellij.openapi.fileTypes.FileTypeFactory;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class CucumberSupportLoader extends FileTypeFactory implements ApplicationComponent { 

    public static final LanguageFileType CUCUMBER = new CucumberFileType();


    public void initComponent() {
    }

    public void disposeComponent() {
    }

    @NotNull
    public String getComponentName() {
        return "Cucumber support loader";
    }

    public FileType getFileType() {
        return CUCUMBER;
    }

    public Icon getIcon(@NotNull final PsiElement element, final int flags) {
        return CucumberIcons.CUCUMBER_FILE_ICON;
    }

    public void createFileTypes(@NotNull FileTypeConsumer consumer) {
        consumer.consume(CUCUMBER, "feature");
    }
}
